<?php echo \think\facade\View::fetch("public/header"); ?>

<div class="cl-cantainer container">
    <div class="row">
        <div class="col-md-9 cl-left">

            <?php foreach ($articleList as $item): ?>
            <div class="cl-card">
                <div class="row">
                    <?php if ($item['cover_image']): ?>
                    <div class="col-lg-3 col-md-4 col-sm-12 cl-card-image">
                        <a href="calmlog-details.html"><img src="<?php echo $item['cover_image']; ?>" class="img-fluid" alt=""></a>
                    </div>
                    <?php endif; ?>
                    <div class="col-lg-9 col-md-8 col-sm-12 cl-card-main">
                        <h3 class="cl-card-main-title"><a href="/index/article/detail/article_id/<?php echo $item['article_id']; ?>/"><?php echo $item['article_title']; ?></a></h3>
                        <p class="cl-card-main-info"><?php echo $item['intro']; ?></p>
                        <p class="cl-card-more"><a href="/index/article/detail/article_id/<?php echo $item['article_id']; ?>/">阅读更多...</a></p>
                    </div>
                </div>
            </div>
            <?php endforeach; ?>

            <nav aria-label="Page navigation example">
                <?php
                $pageHtml = $articleList->render();
                $pageHtml = str_replace(
                    ['<ul class="pagination">', '<li>', '<a href=', '<li class="active">', '<li class="disabled">'],
                    ['<ul class="pagination justify-content-center">'
                        , '<li class="page-item">'
                        , '<a class="page-link" href='
                        , '<li class="page-item active">'
                        , '<li class="page-item disabled">'],
                    $pageHtml
                );
                $pageHtml = preg_replace(
                        "/<span>(.*?)<\/span>/i",
                        '<a class="page-link" href="#">${1}</a>',
                        $pageHtml
                );
                echo $pageHtml;
                ?>
            </nav>

        </div>

        <?php echo \think\facade\View::fetch("public/right"); ?>

    </div>

</div>

<?php echo \think\facade\View::fetch("public/footer"); ?>